home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat España 20
/
macformat_20.iso
/
mac
/
Shareware
/
Desarrolladores
/
Sprite Animation Toolkit 2.3.8
/
Add-ons
/
Load faces
/
FaceFromPICT.c
next >
Wrap
Text File
|
1995-05-01
|
1KB
|
46 lines
// C translation by Adam Wight
#include "SAT.h"
FacePtr GetFaceFromPICT (int colorPICTid,int bwPICTid,int maskPICTid);
/*No error checking yet!*/
FacePtr GetFaceFromPICT (int colorPICTid,int bwPICTid,int maskPICTid) {
Rect bounds;
PicHandle thePICT, maskPICT;
FacePtr theFace;
SATPort savePort;
SATGetPort(&savePort);
/*Get PICTs*/
if (gSAT.initDepth > 1) thePICT = GetPicture(colorPICTid);
else thePICT = GetPicture(bwPICTid);
maskPICT = GetPicture(maskPICTid);
bounds = (*thePICT)->picFrame;
OffsetRect(&bounds, -bounds.left, -bounds.top); /* Unnecessary? I think NewFace does this for us. /Ingemar */
/*Create face*/
theFace = SATNewFace(&bounds);
/*Draw in the face*/
SATSetPortFace(theFace);
DrawPicture(thePICT, &bounds);
SATSetPortMask(theFace);
DrawPicture(maskPICT, &bounds);
/*Tell SAT that we are done*/
SATChangedFace(theFace);
/*Get rid of the PICTs*/
ReleaseResource((Handle)thePICT);
ReleaseResource((Handle)maskPICT);
/*Return the face.*/
SATSetPort(&savePort);
return theFace;
}